from typing import List


class Solution:
    def finalValueAfterOperations(self, operations: List[str]) -> int:
        ans = 0
        for operation in operations:
            if "+" in operation:
                ans += 1
            else:
                ans -= 1
        return ans


if __name__ == "__main__":
    print(Solution().finalValueAfterOperations(operations=["--X", "X++", "X++"]))  # 1
    print(Solution().finalValueAfterOperations(operations=["++X", "++X", "X++"]))  # 3
    print(Solution().finalValueAfterOperations(operations=["X++", "++X", "--X", "X--"]))  # 0
